from artifacts.base.artifacts_impl import *
from artifacts.base.attr_type import AttrType

need_main_attr = {
    Flower: AttrType.SR_SPD,
    Plume: AttrType.SR_SPD,
    Clock: AttrType.HP_P,
    Cup: AttrType.HYDRO_DMG,
    Head: AttrType.CRIT_RATE
}


def evaluate(artifacts):
    score = 0
    if artifacts.main_attr is not need_main_attr[type(artifacts)]:
        return score
    for item in artifacts.bonus_attr_list:
        if item.type == AttrType.CRIT_RATE:
            score += item.data * 2
        if item.type == AttrType.CRIT_DMG:
            score += item.data
        if item.type == AttrType.HP_P:
            score += item.data * 1.3
    return score
